package de.fh.ka.as.car;

import static org.junit.Assert.assertEquals;

import java.util.ArrayList;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;

import android.graphics.PointF;
import de.fh.ka.as.car.routing.AutoPilot;
import de.fh.ka.as.car.routing.RouteCommand;

public class AutoPilotTest {

	private AutoPilot pilot;

	@Before
	public void setUp() throws Exception {
		pilot = new AutoPilot();
	}

	@After
	public void tearDown() throws Exception {
		pilot = null;
	}

	@Test
	public void testToOutput() {
		AutoPilot.calculateEinheitsVector(90.0);
		assertEquals(0.0, 0.0, 0);
	}

	// @Test
	// public void testCalcAngleBetweenThreePoints() {
	// AutoPilot.calcAngleBetweenThreePoints(90,new PointF(0, 0),new PointF(2, 2)); //45
	// AutoPilot.calcAngleBetweenThreePoints(0,new PointF(0, 0),new PointF(2, 2)); //135
	// AutoPilot.calcAngleBetweenThreePoints(180,new PointF(0, 0),new PointF(2, 2));// -45
	// AutoPilot.calcAngleBetweenThreePoints(270,new PointF(0, 0),new PointF(2, 2)); //-135
	//
	// AutoPilot.calcAngleBetweenThreePoints(new PointF(0, 0),new PointF(1, 0),new PointF(-1, 2));
	// }

	@Test
	public void testCalculateRoute() {
		ArrayList<PointF> routePoints = new ArrayList<PointF>();
		routePoints.add(new PointF(0, 0));
		routePoints.add(new PointF(2, 0));
		routePoints.add(new PointF(3, 1));
		routePoints.add(new PointF(6, 1));
		ArrayList<RouteCommand> commands = pilot.calculateRoute(routePoints, 90);
		// for (RouteCommand routeCommand : commands)
		// assert the commands here
	}

	public void testCalculateAngleBetweenTwoVectors() {
		// AutoPilot.calculateAngleBetweenTwoVectors(start, target);
		// ...
	}
}